package com.hdoit.ares.web.acc.modelconfig;
import com.hdoit.ares.web.acc.providers.MoneyTypeProvider;
import com.hdoit.ares.web.acc.providers.StateProvider;
import com.tennetcn.common.enums.regular.MathRegularExpressions;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      caochengmeng
 * @email       
 * @createtime  2017年11月29日 21:06:59
 * @comment
 */
public class AccountDetailConfig extends ModelMetadataAttributeConfiguration{
    public AccountDetailConfig(){
    	
        this.setProperty("account")
            .hasAttribute(new DisplayNameAttribute("会员号"));

        this.setProperty("customerId")
            .hasAttribute(new DisplayNameAttribute("客户Id"));

        this.setProperty("accountNo")
            .hasAttribute(new DisplayNameAttribute("账户号"));

        this.setProperty("moneyType")
            .hasAttribute(new DisplayNameAttribute("交易类型"))
            .hasAttribute(new DropDownListAttribute(new MoneyTypeProvider()));

        this.setProperty("state")
            .hasAttribute(new DisplayNameAttribute("收入/支出"))
            .hasAttribute(new DropDownListAttribute(new StateProvider()));
        
        this.setProperty("serviceId")
            .hasAttribute(new DisplayNameAttribute("交易单号"));

        this.setProperty("time")
            .hasAttribute(new DisplayNameAttribute("交易时间"))
            .hasAttribute(new DateTimeAttribute());

        this.setProperty("money")
            .hasAttribute(new DisplayNameAttribute("交易金额"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.decimalTwo));

        this.setProperty("balance")
            .hasAttribute(new DisplayNameAttribute("剩余金额"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.decimalTwo));

    }
}